﻿using System.Data;

namespace _04_简单工厂;

public class 抽象工厂
{

    public interface IDao
    {
        IDbConnection GetConnection();
    }

    class MsSqlDao : IDao
    {
        public IDbConnection GetConnection()
        {
            throw new NotImplementedException();
        }
    }

    class MySqlDao : IDao
    {
        public IDbConnection GetConnection()
        {
            throw new NotImplementedException();
        }
    }

    public abstract class AbsFactory
    {
        public abstract IDao CreateMsSqlDao();

        public abstract IDao CreateMySqlDao();

        //其他的IDao等等
    }


    public class ERP : AbsFactory
    {
        public override IDao CreateMsSqlDao()
        {
            throw new NotImplementedException();
        }

        public override IDao CreateMySqlDao()
        {
            throw new NotImplementedException();
        }
    }

}
